<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<div class="page-content" ms-controller="logLoginPage">
	<!--content-->
	<div class="monitor">
		<form id="loginLogForm">
			<div class="monitorLeft">
				<div class="form-group">
					<label class="col-sm-4 control-label">用户帐号：</label>
					<div class="col-sm-7 ">
						<div class="pr">
							<input id="account" name="account" type="text" class="form-control"
								placeholder="" :duplex="searchModel.account" />
						</div>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-4 control-label">所属部门：</label>
					<div class="col-sm-7 ">
						<div class="pr">
							<input id="corpName" name="corpName" type="text" class="form-control"
								placeholder="" :duplex="searchModel.corpName" />
						</div>
					</div>
				</div>
				<div class="form-group dateContainer">
					<label class="col-sm-4 control-label">开始时间：</label>
					<div class="col-sm-7 ">
						<div class="pr">
							<input id="beginTimeString" name="beginTimeString" type="text"
								class="form-control datepicker" placeholder=""
								:duplex="searchModel.beginTime">
						</div>
					</div>
				</div>
				<div class="form-group dateContainer">
					<label class="col-sm-4 control-label">结束时间：</label>
					<div class="col-sm-7 ">
						<div class="pr">
							<input id="endTimeString" name="endTimeString" type="text"
								class="form-control endDate datepicker" placeholder=""
								:duplex="searchModel.endTime">
						</div>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-4 control-label">IP地址：</label>
					<div class="col-sm-7 ">
						<div class="pr">
							<input id="loginIp" name="loginIp" type="text" class="form-control"
								:duplex="searchModel.ip" placeholder="">
						</div>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-4 control-label">验证方式：</label>
					<div class="col-sm-7 ">
						<select id="authType" name="authType" class="form-control input-sm"
							:duplex="searchModel.authType">
							<option ms-for="el in @loginTypeModel" ms-attr="{value: el.type}">{{el.name}}</option>
						</select>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-4 control-label">行为状态：</label>
					<div class="col-sm-7 ">
						<select id="loginResult" name="loginResult" class="form-control input-sm"
							:duplex="searchModel.loginResult">
							<option ms-for="el in @loginStatus" ms-attr="{value: el.status}">{{el.name}}</option>
						</select>
					</div>
				</div>

			</div>

			<!-- log.searchLoginLog() 定义在work.js的文件里面 -->
			<div class="monitorRight">
				<a href="javascript:void(0);" class="btnSearch"
					onclick="log.searchLoginLog();">查询</a> 
			</div>
		</form>
	</div>
	<div class="clearfix"></div>
	<div class="portlet-body">
		<div class="table-scrollable">
			<table class="logList table table-condensed flip-content">
				<thead class="flip-content">
					<tr>
						<th width="15%">登录帐号</th>
						<th width="15%">所属部门</th>
						<th width="15%">登录IP</th>
						<th width="15%">认证方式</th>
						<th width="15%">登录时间</th>
						<th width="10%">登录状态</th>
						<th>备注</th>
						<%--<th width="10%" class="text-center">操作</th>--%>
					</tr>
				</thead>
				<tbody id="select_tbody">

					<c:if test="${result.code eq 'SUCCESS' }">
						<c:forEach items="${result.data.rows}" var="row" varStatus="status">
							<tr>
								<td class="">${row.account}</td>
								<td class="">${row.corpName}</td>
								<td class="">${row.ip}</td>
								<td class="">
								  <c:choose>
								     <c:when test="${row.authType eq 1}">人脸比对</c:when>
								     <c:when test="${row.authType eq 2}">验证码</c:when>
								     <c:when test="${row.authType eq 3}">指纹</c:when>
								     <c:when test="${row.authType eq 4}">密码</c:when>
								  </c:choose>					
								
								</td>
								<td class=""><fmt:formatDate value="${row.createTime }"
										pattern="yyyy-MM-dd HH:mm:ss" /></td>
								<td class="">${row.loginResult == 1 ? "成功" : "失败"}</td>
								<td class="">${row.note}</td>
								<%--<td class="text-center">--%>
								<%--<a href="javascript:;" class="a-detial">删除</a>--%>
								<%--</td>--%>
							</tr>
						</c:forEach>
					</c:if>
				</tbody>
			</table>
		</div>
	</div>



	<!--end content-->
</div>

<c:if test="${result.code eq 'SUCCESS' }">

	<script type="text/javascript">
		Page.navigation('page', 'log/login/page', 'log:page',
				'${result.data.pageSize}', '${result.data.total}',
				'${result.data.pageCount}', '${result.data.currPage}',
				'menuUrl');
	</script>

	<div id="page" class="page"></div>

</c:if>

<%--<div class="page">--%>
<%--<a href="javascript:;">上一页</a>--%>
<%--<a href="javascript:;">1</a>--%>
<%--<a href="javascript:;">2</a>--%>
<%--<a href="javascript:;" class="active">3</a>--%>
<%--<a href="javascript:;">4</a>--%>
<%--<a href="javascript:;">5</a>--%>
<%--<a href="javascript:;">下一页</a>--%>
<%----%>
<%--到第 <input type="text" name=""  value="" /> 页--%>
<%--<a href="javascript:;" class="gopage">确定</a>--%>
<%--</div>--%>
<script
	src="resources/js/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js"></script>
<script
	src="resources/js/bootstrap-datepicker/dist/locales/bootstrap-datepicker.zh-CN.min.js"></script>
<link rel="stylesheet"
	href="resources/js/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css" />
<script src="resources/js/app/log.js"></script>
